import React,{ memo } from "react";
import PropTypes from "prop-types";
import {CustomRate, RoomItemWarpper} from "@/components/room-item/style";
import { Rate } from 'antd';
/**
 * @type {React.NamedExoticComponent<object>}
 */
const RoomItem = memo((props) => {
    const {itemData} = props


    return (
        //itemData?.verify_info?.text_color || "#39576a"
        <RoomItemWarpper verifycolor = {itemData?.verify_info?.text_color || "#39576a"}>
            {/*<label>{itemData.name}</label>*/}
            <div className="inner">
                <div className="cover">
                    <img src={itemData.picture_url} alt="" className="image-div"/>
                </div>
                <div className="desc">
                    {itemData.verify_info?.messages?.join(" · ")}
                </div>
                <div className="title-sty">
                    {itemData.name}
                </div>
                <div className="price">
                    {"￥" + itemData.price + "/晚"}
                </div>
                <div className="bottom">
                    <CustomRate className="rating-style" allowHalf
                          defaultValue={itemData.bottom_info?.visibility === "LIST_VIEW" ? 5 : 3} disabled={true} />
                    <div className="rating-detail">
                        {itemData.bottom_info?.content}
                    </div>
                </div>
            </div>



        </RoomItemWarpper>
    )
})
RoomItem.propTypes = {
    itemData:PropTypes.object
}
export default RoomItem
